﻿@model IEnumerable<FILSTARTUPS_CMS.Models.PostGrid>
<!-- WEBGRID -->

@using FILSTARTUPS_CMS.Helpers;

@{
    WebGrid webGrid = new WebGrid(canSort: true, canPage: true, rowsPerPage: 5, ajaxUpdateContainerId: "grid");
    webGrid.Bind(Model, autoSortAndPage: true, rowCount: Model.Count());
    
 }

 <div id="grid">
   @webGrid.GetHtml(htmlAttributes: new { id = "grid" },
alternatingRowStyle: "altrow",
mode: WebGridPagerModes.All,
    firstText: "<<first",
    previousText: "<previous",
    nextText: "next >",
    lastText: "last >>",
    columns: webGrid.Columns(
    webGrid.Column("Postname", "Post Title", format: @<b>@Session_Helper.Truncate(item.posttitle,10)</b>),
   webGrid.Column("View Type", "Display Mode", format: @<b>@item.viewtype</b>),
    webGrid.Column("Datecreated", "Datecreated", format: @<b>@item.datecreated.ToString("MMMM d, yyyy")</b>),
    webGrid.Column("Category", "Category", format: @<b>@Session_Helper.Truncate(item.categoryname, 15)</b>),
    webGrid.Column(header: "Action",
            style: "action",
            format: (item) => new HtmlString(Html.ActionLink("View", "Details", new { id = item.postidPK }) + " | " +
                        Html.ActionLink("Edit", "Edit", new { id = item.postidPK }))
            )))

          </div>
<!-- END WEBGRID -->

